import request from '@/router/axios';

// 列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

// 新增
export const add = (row) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/save',
    method: 'post',
    data: row
  })
}

// 修改
export const update = (row) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/update',
    method: 'post',
    data: row
  })
}

// 修订
export const revise = (row) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/amendmentOfSafeOperatingProcedures',
    method: 'post',
    data: row
  })
}

// 状态字典
export const getStatusList = () => { 
  return request({
    url: '/api/blade-system/dict-biz/dictionary?code=institutionalStatus',
    method: 'get'
  })
}

// 作废
export const invalid = (ids) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/invalid',
    method: 'post',
    params: {
      ids,
    }
  })
}

// 审核批准
export const modifyStatus = (id, zt, passed) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/modifyStatus',
    method: 'post',
    data: {
      id,
      zt,
      passed
    }
  })
}

// 添加评审记录
export const addReviewRecord = (row) => {
  return request({
    url: '/api/securitySystemManagement/reviewrecord/save',
    method: 'post',
    data: row
  })
}

// 修订记录列表
export const getReviseRecordList = (current, size, params) => {
  return request({
    url: '/api/securitySystemManagement/optprocedures/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 获取人员列表
export const getUserList = () => { 
  return request({
    url: '/api/riskPoint/riskmanagement/getInternalStaff',
    method: 'get'
  })
}